package com.lizhi.yun.db.stand.pojo;/**
 * @program: upp
 * @name SerilaManagePOJO
 * @description:
 * @author: lizhi
 * @create: 2020-06-02 11:00
 */

import com.lizhi.mybatis.boot.Description;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

/**
 *@program: upp
 *@name SerilaManagePOJO
 *@description:
 *@author: lizhi
 *@create: 2020-06-02 11:00
 */
@Data
@ToString
@Entity
@Table(name = "stand_serial_manage")
@Description("串口管理")
public class SerialManagePOJO {

    @Id
    @Column(length = 30)
    @Description("lid")
    public String lid;

    @Column(length = 300)
    @Description("主键")
    private String code;

    @Column(length = 500)
    @Description("串口名")
    private String serialPortname;

    @Column
    @Description("串口特率")
    private int serialBaudrate;

    @Column(length = 2)
    @Description("运行状态（00-启动，01-停止）")
    private String serialStatus;

    @Transient
    @Description("运行状态")
    private String serialStatusText;

    @Column(length = 19)
    @Description("插入时间")
    private String serialIstTm;

    @Column(length = 19)
    @Description("更新时间")
    private String serialUpdTm;

    @Column(length = 2)
    @Description("上传云管的状态(00-未上传，01-已上传)")
    private String dataUpState;

    @Transient
    @Description("上传云管的状态")
    private String dataUpStateText;

    @Column(length = 19)
    @Description("患者信息上传到云管的时间")
    private String dataUpTime;


    /*云管需要的数据*/
    @Column(length = 200)
    @Description("医院ID")
    private String hospitalId;

    @Column(length = 200)
    @Description("系统ID")
    private String hospitalSystemId;

    public String getSerialStatusText() {
        if ("00".equals(this.serialStatus)){
            this.serialStatusText = "启动";
        } else if ("01".equals(this.serialStatus)){
            this.serialStatusText = "停止";
        }
        return serialStatusText;
    }
}
